
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>ERP库存同步</title>
</head>
<body>
<div class="pd-20">
	<div class="form form-horizontal">
		<div class="row cl">
			<input type="hidden" id="id" name="id" value='${city.id}' />
			<label class="form-label col-2">ERP编号：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text"  placeholder="输入ERP货品编号或者商品编号" id="erp_product_id" name="erp_product_id" nullmsg="不能为空">
			</div>
			<div class="formControls col-6">     备注: 不输入编号 则同步所有ERP货品 </div>
		</div>

		<div class="row cl">
			<label class="form-label col-2"></label>
			<div class="formControls col-10 c-red" id="div_result"> </div>
		</div>

		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="stock_save_submit();" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>

	</div>



		<div class="row cl pd-20">
			<label class="form-label col-2"></label>
			<div class="formControls col-6 pd-20">备注: 手动同步订单 </div>
		</div>

		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="order_save_submit();" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe632;</i> 同步订单</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-2"></label>
			<div class="formControls col-10 c-red" id="div_result2"> </div>
		</div>


	</div>



</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript">

function stock_save_submit(){

	layer.confirm('确认同步？', {
		btn: ['确认','取消'], 
		shade: false
	},
	function(){
		$("#div_result").html("处理中...");
		//start
		erp_product_id = $("#erp_product_id").val();
		$.ajax({
			type:"post",
			async:false,
			url:"<%=path%>/backstage/erp-stock-update",
			data : {erp_product_id:erp_product_id},
			success : function(msg){
				msg = JSON.parse(msg);
				//alert(msg.information);
				$("#div_result").html(msg.information);
			}
		});
		//end
		layer.close();
	},
	function(){
		layer.msg('未操作', {icon:5,time:1000});
	});	

}

function order_save_submit(){

	layer.confirm('确认同步？', {
		btn: ['确认','取消'], 
		shade: false
	},
	function(){
		$("#div_result2").html("订单同步处理中...");
		//start
		$.ajax({
			type:"post",
			async:false,
			url:"<%=path%>/backstage/erp-order-update",
			data : "",
			success : function(msg){
				msg = JSON.parse(msg);
				//alert(msg.information);
				$("#div_result2").html(msg.information);
			}
		});
		//end
		layer.close();
	},
	function(){
		layer.msg('未操作', {icon:5,time:1000});
	});	

}

</script>
</body>
</html>